package response

type Response struct {
	Code    int64  `json:"code"`
	Message string `json:"message"`
	Data    any    `json:"data"`
}

type PaginationResponse struct {
	Page  int           `json:"page"`
	Size  int           `json:"size"`
	Total int64         `json:"total"`
	List  []interface{} `json:"list"`
}

type PageResponse[T any] struct {
	Page  int   `json:"page"`
	Size  int   `json:"size"`
	Total int64 `json:"total"`
	List  []T   `json:"list"`
}

type BaseResponse struct {
	ID          string `json:"id" mapstructure:"id"`
	CreatedAt   int64  `json:"created_at" mapstructure:"created_at"`
	CreatedAtBy string `json:"created_at_by" mapstructure:"created_at_by"`
	UpdatedAt   int64  `json:"updated_at" mapstructure:"updated_at"`
	UpdatedAtBy string `json:"updated_at_by" mapstructure:"updated_at_by"`
	Status      int    `json:"status" mapstructure:"status"`
	StatusName  string `json:"status_name" mapstructure:"status_name"`
	Description string `json:"description" mapstructure:"description"`
}

type ServiceError struct {
	Code int64
	Err  error
}
